package com.example.demo.huawei;

import java.util.Scanner;

/*
求字符串中所有整数的最小和
正数 拆分为个位数 相加
负数 合并为一个大负数
 */
public class OD63_2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        char[] array = s.toCharArray();
        int sum = 0;
        for (int i = 0; i < array.length; i++) {
            if (Character.isLetter(array[i])) {
            } else if (array[i] == '-') {
                // -号后面跟的数字
                int j = i + 1;
                while (j < array.length && Character.isDigit(array[j])) {
                    j++;
                }
                int anInt = Integer.parseInt(s.substring(i, j));
//                System.out.println(anInt);
                sum = sum + anInt;
                i = j - 1;
            } else {
                int j = i + 1;
                while (j <= array.length && Character.isDigit(array[i])) {
                    int anInt = Integer.parseInt(s.substring(i, j));
//                    System.out.println(anInt);
                    sum = sum + anInt;
                    i++;
                    j++;
                }
                i--;
            }
        }

        System.out.println(sum);
    }
}
